package com.macro.mall.dao;

import com.macro.mall.dto.OmsOrderDeliveryParam;
import com.macro.mall.dto.OmsOrderDetail;
import com.macro.mall.dto.OmsOrderQueryParam;
import com.macro.mall.model.OmsOrder;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 订单自定义查询Dao
 */
public interface OmsOrderDao {
    /**
     * 条件查询订单
     */
    List<OmsOrder> getList(@Param("queryParam") OmsOrderQueryParam queryParam);

    /**
     * 批量发货
     */
    int delivery(@Param("list") List<OmsOrderDeliveryParam> deliveryParamList);

    /**
     * 获取订单详情
     */
    OmsOrderDetail getDetail(@Param("id") Long id);

    /**
     * 根据查询key查询数量
     * @param storeId
     * @param key
     * @return
     */
    Integer selectStatisticsByKey(@Param("storeId") Long storeId, @Param("key") String key,@Param("value") Integer value);

    /**
     * 分组查询店铺id
     * @return
     */
    List<Long> selectStoreId();

    /**
     * 查询订单统计折线图数据
     * @param storeIds
     * @return
     */
    List<Map<String, Object>> orderLiceChart(@Param("storeIds") List<Long> storeIds, @Param("queryWay")Integer queryWay, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 查询订单统计折线图数据
     * @param storeId
     * @return
     */
    List<Map<String, Object>> orderLiceChartOne(@Param("storeId") Long storeId,@Param("queryWay")Integer queryWay,@Param("startDate") Date startDate,@Param("endDate") Date endDate);

    /**
     * 查询销售额统计折线图数据
     * @param storeIds
     * @return
     */
    List<Map<String, Object>> orderSalesLiceChart(@Param("storeIds") List<Long> storeIds, @Param("queryWay")Integer queryWay, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 查询销售额统计折线图数据
     * @param storeId
     * @return
     */
    List<Map<String, Object>> orderSalesLiceChartOne(@Param("storeId") Long storeId,@Param("queryWay")Integer queryWay,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
}
